Skip to content

feat: add logger class util in @metamask/snap-networks-utils - #136

Open
taran-a wants to merge 1 commit into
mainfrom
feat/add-logger-util
Open

feat: add logger class util in @metamask/snap-networks-utils#136
taran-a wants to merge 1 commit into
mainfrom
feat/add-logger-util

Conversation

@taran-a

@taran-a taran-a commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Explanation

Snap-networks-utils package update

Add Logger shared utils class. See readme file with the usage exmaples.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@taran-a
taran-a requested a review from a team as a code owner August 6, 2026 17:45
@taran-a
taran-a temporarily deployed to default-branch August 6, 2026 19:14 — with GitHub Actions Inactive

constructor({
enabled,
level = LogLevel.TRACE,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we using super struct to gate the config / coerce the config, since TS is fake strong type

especially the level , it is nice to have not a blocker

sth like that

export const LogLevelStruct = coerce(
  defaulted(enums(Object.values(LogLevel)), LogLevel.ERROR),
  string(),
  (value: string) => (value === '' ? undefined : value.toLowerCase()),
);


## Usage

```typescript

@stanleyyconsensys stanleyyconsensys Aug 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we dont need to add a additional readme?

the "example / how to use" can include form the JS DOC of the logger
hence, Editor hover / autocomplete will appear to the developer ?

wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants